package com.yearner.reviewplan.user.model;

import com.yearner.reviewplan.user.commands.RegisterUserAccountCommand;
import lombok.Data;

/**
 * 包含帐号密码等信息的账户
 * @author pengyg
 * @since 2019/10/16
 */
@Data
public class Account {
    private String accountName;
    private String password;

    public Account(){}

    public Account(String name, String password) {
        this.accountName = name;
        this.password = password;
    }

    public static Account create(RegisterUserAccountCommand command) {
        return new Account(command.getAccountName(), command.getPassword());
    }
}
